import { request } from '../network/request.js'

export default {
    namespaced: true,
    state: {
        arr: [],
    },
    getters: {
    },
    mutations: {
        changearr(state, arr) {
            // console.log(arr,state.arr)
          state.arr = arr
        },
    },
    actions: {
        //渲染
        async getOrder(context) {
            const msg = await request({
                url: "/order/getUserOrder",
                method: "post",
                // params: {
                //   currentPage:currentPage,
                //   pageSize:pageSize
                // }
            });
            console.log(msg.rows.data)
            //   context.state.arr = msg.rows.data;
              context.commit('changearr', msg.rows.data)//因为不能在action中修改，所以将数据传到mutations中再修改
            //   context.commit('changetotal', msg.total)//因为不能在action中修改，所以将数据传到mutations中再修改
        },
    },



}